package net.esj.basic.core.engine.support;

import javax.validation.Validator;

import net.esj.basic.core.engine.support.message.MessageProvider;
import net.esj.basic.core.engine.support.translator.Translator;
import net.esj.basic.core.engine.tools.crypt.inst.PwdEncryptor;
import net.esj.basic.core.view.Viewer;
import net.esj.basic.core.view.tools.AgentContext;
import net.esj.basic.dao.DaoProxy;
import net.esj.basic.service.Service;

public class MelonSupporter  {

	private static PwdEncryptor pwdEncryptor;
	
	private static Translator translator;
	
	private static Validator validator;

	private static DaoProxy daoProxy;
	
	private static MessageProvider messageProvider;
	
	private static Viewer viewer;
	
	private static Service service;
	
	public static String SYS_ENCODING = "UTF-8"; 
	
	
	public static PwdEncryptor getPwdEncryptor() {
		return pwdEncryptor;
	}

	public static Translator getTranslator() {
		return translator;
	}

	public static Validator getValidator() {
		return validator;
	}
	
	public static <T> T getDao(Class<T> daoClass){
		return daoProxy.getProxy(daoClass);
	}

	public void setPwdEncryptor(PwdEncryptor pwdEncryptor) {
		this.pwdEncryptor = pwdEncryptor;
	}

	public void setTranslator(Translator translator) {
		this.translator = translator;
	}

	public void setValidator(Validator validator) {
		this.validator = validator;
	}

	public static MessageProvider getMessageProvider() {
		return messageProvider;
	}

	public void setMessageProvider(MessageProvider messageProvider) {
		MelonSupporter.messageProvider = messageProvider;
	}

	public static DaoProxy getDaoProxy() {
		return daoProxy;
	}

	public void setDaoProxy(DaoProxy daoProxy) {
		MelonSupporter.daoProxy = daoProxy;
	}

	public static Viewer getViewer() {
		return viewer;
	}

	public void setViewer(Viewer viewer) {
		MelonSupporter.viewer = viewer;
	}

	public static Service getService() {
		return service;
	}

	public void setService(Service service) {
		MelonSupporter.service = service;
	}
	
}
